import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login'
import Register from '../views/Register'
import Study from '../views/study'
import Content from '../views/content'
import HomeworkManage from '../views/homeworkManage.vue'
import Manage from '../views/manage'
import Guanliyuanguanli from '../views/guanliyuanguanli'
import Xueshengguanli from '../views/xueshengguanli'
import Xueshengliebiao from '../components/xueshengliebiao'
import Kechengbanjiguanli from '../components/kechengbanjiguanli'
import Guanliyuanliebiao from '../components/guanliyuanliebiao'
import Ketangneironggaunli from '../views/ketangneironggaunli'
import Ketangneironggaunlishu from '../components/ketangneirongguanlishu'
import Kehouzuoyeguanli from '../components/kehouzuoyeguanli'
import Kejianbianji from '../components/kejianbianji'
import PublishHomework from '../views/publishHomework.vue'
import JudgeHomework from '../views/judgeHomework.vue'
import GradeManage from '../views/gradeManage.vue'
import CreatHomeWork from '../components/publishHomework/creatHomeWork.vue'
import ViewHomework from '../components/judgeHomework/viewHomework.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Login',
    component: Login,
  },
  {
    path: '/register',
    name: 'Register',
    component: Register,
  },
  {
    path: '/study',
    name: 'study',
    component: Study,
    children: [
      {
        path: 'content/:key',
        name: 'Content',
        component: Content,
      },
      {
        path: 'homeworkManage/:key',
        name: 'HomeworkManage',
        component: HomeworkManage,
      },
      ,
    ],
  },
  {
    path: '/manage',
    name: 'manage',
    component: Manage,
    children: [
      {
        path: 'guanliyuanguanli',
        name: 'guanliyuanguanli',
        component: Guanliyuanguanli,
        children: [
          {
            path: 'guanliyuanliebiao',
            name: 'guanliyuanliebiao',
            component: Guanliyuanliebiao,
          },
        ],
      },
      {
        path: 'xueshengguanli',
        name: 'xueshengguanli',
        component: Xueshengguanli,
        children: [
          {
            path: 'xueshengliebiao',
            name: 'xueshengliebiao',
            component: Xueshengliebiao,
          },
          {
            path: 'kechengbanjiguanli',
            name: 'kechengbanjiguanli',
            component: Kechengbanjiguanli,
          },
        ],
      },
      {
        path: 'ketangneirongguanli',
        name: 'ketangneirongguanli',
        component: Ketangneironggaunli,
        children: [
          {
            path: 'ketangneirongguanlishu',
            name: 'ketangneirongguanlishu',
            component: Ketangneironggaunlishu,
          },
          {
            path: 'kehouzuoyeguanli',
            name: 'kehouzuoyeguanli',
            component: Kehouzuoyeguanli,
          },
          {
            path: 'kejianbianji',
            name: 'kejianbianji',
            component: Kejianbianji,
          },
        ],
      },
      {
        path: 'publishHomework',
        name: 'publishHomework',
        component: PublishHomework,
        children: [
          {
            path: 'creatHomeWork',
            name: 'creatHomeWork',
            component: CreatHomeWork,
          },
        ],
      },
      {
        path: 'judgeHomework',
        name: 'judgeHomework',
        component: JudgeHomework,
        children: [
          {
            path: 'viewHomework',
            name: 'viewHomework',
            component: ViewHomework,
          },
        ],
      },
      {
        path: 'gradeManage',
        name: 'gradeManage',
        component: GradeManage,
      },
    ],
  },
]

const router = new VueRouter({
  routes,
})

export default router
